package com.chengda.dashboard.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chengda.dashboard.entity.SysTemporary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 系统临时数据Mapper接口
 */
@Mapper
public interface SysTemporaryMapper extends BaseMapper<SysTemporary> {

    /**
     * 根据类型和名称获取值
     * @param type 类型
     * @param name 名称
     * @return 值
     */
    @Select("SELECT value FROM sys_temporary WHERE type = #{type} AND name = #{name}")
    String getValueByTypeAndName(@Param("type") Integer type, @Param("name") String name);
    
    /**
     * 根据类型和名称获取值（字符串类型）
     * @param type 类型（字符串）
     * @param name 名称
     * @return 值
     */
    @Select("SELECT value FROM sys_temporary WHERE type = #{type} AND name = #{name}")
    String getValueByTypeAndNameStr(@Param("type") String type, @Param("name") String name);
}
